# New ports collection makefile for: gigolo
# Date created:		2010-09-03
# Whom:		Olivier Duchateau <duchateau.olivier@gmail.com>
#
# $FreeBSD: $
#

PORTNAME=	gigolo
PORTVERSION=	0.4.1
CATEGORIES=	sysutils xfce
MASTER_SITES=	${MASTER_SITE_XFCE}
MASTER_SITE_SUBDIR=	src/apps/${PORTNAME}/${PORTVERSION:R}
DIST_SUBDIR=	xfce4

MAINTAINER=	duchateau.olivier@gmail.com
COMMENT=	Gigolo is a frontend to manage connections to remote filesystems

RUN_DEPENDS=	python:${PORTSDIR}/lang/python
LIB_DEPENDS=	gvfscommon.0:${PORTSDIR}/devel/gvfs

USE_BZIP2=	yes
USE_PYTHON=	yes
USE_GETTEXT=	yes
USE_GNOME=	gtk20 glib20 intltool intlhack desktopfileutils pkgconfig
USE_XORG=	x11

CONFIGURE_ENV+=	CC="${CC=gcc}"
CONFIGURE_ARGS+=	--prefix=${LOCALBASE}

SUB_FILES=	pkg-message
PKGMESSAGE=	${WRKDIR}/pkg-message

MAN1=	gigolo.1

.include <bsd.port.pre.mk>

.if !exists(${LOCALBASE}/modules/fuse.ko)
IGNORE=	Enable FUSE support in ${PORTSDIR}/devel/gvfs
.endif

# Only i386/amd64 due to limitations of fusefs-kmod  
.if ${ARCH} != "i386" && ${ARCH} != "amd64"
BROKEN=	Does not compile on other than i386/amd64
.endif

.if !defined(NO_LICENSES_INSTALL)
LICENSE=	GPLv2
LICENSE_FILE_GPLv2=	${WRKSRC}/COPYING

PLIST_SUB=	LICENSE="@comment "
.else
PLIST_SUB=	LICENSE=""
.endif

post-patch:
.if !defined(NO_LICENSES_INSTALL)
	@${REINPLACE_CMD} -e 's| COPYING||' ${WRKSRC}/wscript
.endif

do-configure:
	@cd ${WRKSRC} && ${SETENV} ${PYTHON_CMD} waf configure \
		${CONFIGURE_ARGS} && ${TRUE}

do-build:
	@cd ${WRKSRC} && ${SETENV} ${PYTHON_CMD} waf build && ${TRUE} 

do-install:
	@cd ${WRKSRC} && ${SETENV} ${PYTHON_CMD} waf install && ${TRUE}

post-install:
	@-update-desktop-database

	@${ECHO_MSG}
	@${CAT} ${PKGMESSAGE}
	@${ECHO_MSG}

.include <bsd.port.post.mk>
